![]() |
SpaceExtra |
||||
Header: | QuickdrawText.h | Carbon status: | Supported | |
Specifies the number of pixels by which to widen (or narrow) each space in a style run to be drawn in the current graphics port.
void SpaceExtra ( Fixed extra );
The amount (in pixels or binary fractions of a pixel) to widen (or narrow) each space in a style run on a line.
The SpaceExtra function sets the value of the extra space (spExtra) field in the current graphics port structure. The initial setting is 0. You can pass a negative value for the extra parameter, but be careful not to narrow spaces so much that the text is unreadable. The value you specify is added to the width of each space character in the style run. For those script systems that do not use spaces, any value set in the extra space field is ignored. For those script systems that use spaces as delimiters, if you do not want to justify a line of text using DrawJustified, you can use the SpaceExtra function to set a fixed number of pixels to be added to each space character, then call DrawText or DrawString.
When you use the justification functions (MeasureJustified, DrawJustified) to measure or draw justified text, they temporarily reset the extra space value. They add to the current value of the field, if any, the amount of extra space to be added to space characters in the specified text in order to justify the text, based on calculations that take into account the slop value for the range of text and all of the text characteristics. On exit, these functions restore the original value.
For a color graphics port (CGrafPort), you can use SpaceExtra by itself or in conjunction with the CharExtra function to format a line of text in the 1-byte simple or 2-byte script systems. You should not use CharExtra for 1-byte complex script systems.
To ensure future compatibility and benefit from any enhancements, always use this function to modify the spExtra field, rather than directly change the field value.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)